#pragma once

#include <vector>

using namespace std;

class tree_list_info
{
public:
	int				m_nLevel;
	int				m_nImage;
	vector<CString>	m_lstCols;
	bool			m_bCollapsed;
};

class CTreeListCtrl: public CListCtrl
{
// Construction
public:
	CTreeListCtrl();
	BOOL			Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);

// Attributes
public:

// Operations
public:
	int				AddItem(LPCTSTR lpszItem, int nLevel);
	BOOL			SetItemText( int nItem, int nSubItem, LPCTSTR lpszText );
	BOOL			DeleteAllItems();
	int				Expand(int nItem, bool bRecursive, int& nCounterInsert);
					
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTreeListCtrl)
	protected:
	virtual void	PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual			~CTreeListCtrl();

	// Generated message map functions
protected:
	//{{AFX_MSG(CTreeListCtrl)

	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

	int				InsertItem(int nItem, int nPosArray, tree_list_info& info);
	void			Collapse(int nPos, int nItem);
	
protected:
	CImageList				m_ilState;
	vector<tree_list_info>	m_tree;
};